package com.codewsq.springboot.controller;

import com.codewsq.springboot.service.AsyncService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = {"异步任务接口"})
@RestController
public class AsyncController {

    @Autowired
    private AsyncService service;

    @ApiOperation(value = "异步任务",notes = "这仅仅是一个异步任务demo",httpMethod = "GET")
    @GetMapping("/async/task")
    public String async(String name){
        service.asyncTask(name);
        return "运行完成";
    }
}
